﻿using System;

namespace Myotragus.Data.Containers
{
	/// <summary>
	/// Holds a singleton instance for every registered service
	/// </summary>
	public interface IServicesContainer
	{
		/// <summary>
		/// Resolves a registered service, provided an interface. Services are register as singleton
		/// </summary>
		/// <seealso cref="Resolve(Type)"/>
		/// <typeparam name="TService">Interface service type</typeparam>
		/// <returns>Service instance</returns>
		TService Resolve<TService>();

		/// <summary>
		/// Resolves a registered service, provided an interface. Services are register as singleton
		/// </summary>
		/// <seealso cref="Resolve{TService}()"/>
		/// <param name="tService">Interface service type</param>
		/// <returns>Service instance</returns>
		object Resolve(Type tService);
	}
}